import datetime


from applications.extensions import db

#情景对抗训练项
class TrainType(db.Model):
    __tablename__ = 'admin_train_type'
    id = db.Column(db.Integer, primary_key=True, comment='训练编号')
    scene_type = db.Column(db.String(30), comment='情景名称')
    train_type = db.Column(db.String(30), comment=' 训练项名称')
    enable = db.Column(db.Integer, comment='是否开启')
    registration_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='注册时间')
    update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')

class TrainData(db.Model):
    __tablename__ = 'admin_train_data'
    id = db.Column(db.Integer, primary_key=True,comment = '训练数据编号')
    user_id = db.Column(db.Integer,  comment='警员编号')
    type_id = db.Column(db.Integer, comment = '训练编号')
    scene_name = db.Column(db.String(30), comment='情景名称')
    train_name = db.Column(db.String(30), comment=' 训练项名称')
    user_name = db.Column(db.String(20), comment='警员姓名')
    enable = db.Column(db.Integer, comment='是否开启')
    train_data = db.Column(db.String(30), comment='训练日期')
    start_time = db.Column(db.DateTime, comment='开始时间')
    end_time = db.Column(db.DateTime, comment='结束时间')
    train_grade = db.Column(db.String(30),comment='训练评分')
    train_recording = db.Column(db.String(100),comment='训练录像')


class TrainData2(db.Model):
    __tablename__ = 'admin_train_data2'
    id = db.Column(db.Integer, primary_key=True,comment = '训练数据编号')
    user_id = db.Column(db.Integer, comment='警员编号')
    type_id = db.Column(db.Integer, comment = '训练编号')
    scene_name = db.Column(db.String(30), comment='情景名称')
    train_name = db.Column(db.String(30), comment=' 训练项名称')
    user_name = db.Column(db.String(20), comment='警员姓名')
    enable = db.Column(db.Integer, comment='是否开始训练')
    train_data = db.Column(db.String(30), comment='训练日期')
    start_time = db.Column(db.DateTime, comment='开始时间')
    end_time = db.Column(db.DateTime, comment='结束时间')

class SignsData2(db.Model):
    __tablename__ = 'admin_rate_signs'
    id = db.Column(db.Integer, primary_key=True,comment = '编号')
    user_id = db.Column(db.Integer, comment='警员编号')
    user_name = db.Column(db.String(20), comment='警员姓名')
    heart_rate_time = db.Column(db.String(40), comment='最近一次心率记录时间')
    heart_rate = db.Column(db.String(20), comment='最近一次心率')
    temp_time = db.Column(db.String(40), comment='最近一次体温记录时间')
    temperature = db.Column(db.String(20), comment='最近一次体温')
    sn = db.Column(db.String(20), comment='设备SN')

